MODULE triangle
IMPLICIT NONE
CONTAINS

REAL FUNCTION Area(a,b,c)
REAL,INTENT(IN) :: a,b,c
REAL :: s	!semi perimeter
s=(a+b+c)/2.0
Area = SQRT(s*(s-a)*(s-b)*(s-c))
END FUNCTION AREA

END MODULE triangle

PROGRAM heron
USE triangle
IMPLICIT NONE
REAL :: a,b,c
PRINT *, 'Enter the three sides of a triangle'
PRINT *,'a:'; READ *,a
PRINT *,'b:'; READ *,b
PRINT *,'c:'; READ *,c
PRINT *,'Area = ',Area(a,b,c)
END PROGRAM
